package com.gopay.common.cps.dao.wallet.tyy.impl;

import com.gopay.common.base.dao.impl.BaseDAOImpl;
import com.gopay.common.cps.dao.wallet.tyy.WaTyyCustInfoDao;
import com.gopay.common.domain.dps.WaTyyCustGenInfo;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author byp
 * @date 2016年09月21日 下午6:46:00
 * www.gopay.com.cn Inc.All rights reserved.
 */
@Repository("waTyyCustInfoDao")
public class WaTyyCustInfoDaoImpl extends BaseDAOImpl<WaTyyCustGenInfo, String> implements WaTyyCustInfoDao {
    @Override
    public void updateRiskEstimateTestScore(WaTyyCustGenInfo waTyyCustGenInfo) {
        Map<String,Object> map = new HashMap();
        StringBuffer  sql = new StringBuffer();
        waTyyCustGenInfo.setLastUpTime(new Date());
        waTyyCustGenInfo.setTestTime(new Date());
        sql.append("Update WaTyyCustGenInfo w set w.testTime=:testTime , w.testScore=:testScore where w.custId=:custId" );
        map.put("testTime",waTyyCustGenInfo.getTestTime());
        map.put("testScore",waTyyCustGenInfo.getTestScore());
        map.put("custId",waTyyCustGenInfo.getCustId());
        updateByHql(sql.toString(),map);
    }
}
